//
//  GDCarPlateInputAccessoryViewCell.m
//  CarPlateInputViewDemo
//
//  Created by ilongge on 2020/10/22.
//

#import "GDCarPlateInputAccessoryViewCell.h"

@interface GDCarPlateInputAccessoryViewCell()

@property (weak, nonatomic) IBOutlet UILabel *title;

@end

@implementation GDCarPlateInputAccessoryViewCell

+ (instancetype)carPlateInputAccessoryViewCell:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath
{
    GDCarPlateInputAccessoryViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:[[GDCarPlateInputAccessoryViewCell class] description]
                                                                              forIndexPath:indexPath];
    return cell;
}

- (void)awakeFromNib
{
    [super awakeFromNib];
    self.layer.borderWidth = 1.0;
    self.layer.borderColor = ColorFromHex(0xCECECE, 1).CGColor;
}

- (void)configText:(NSString *)title andActive:(BOOL)isActive
{
    self.title.text = title;
    
    if ([title isEqualToString:NewEnergyResources])
    {
        self.title.font = [UIFont systemFontOfSize:9];
    }
    else
    {
        self.title.font = [UIFont systemFontOfSize:25 weight:UIFontWeightMedium];
    }
    
    if (isActive)
    {
        self.title.backgroundColor = ColorFromHex(0xB1DEFF, 1);
    }
    else
    {
        self.title.backgroundColor = [UIColor whiteColor];
    }
}

@end
